import request from '@/utils/request'

// 合同列表
export function contractList(data: any) {
  return request({
    url: '/scrm-api/console/sale/contract/list',
    method: 'post',
    data
  })
}

//高级设置-查看
export function getSetting() {
  return request({
    url: '/scrm-api/console/sale/contract/get-setting',
    method: 'get'
  })
}

//高级设置设置
export function setSetting(data: any) {
  return request({
    url: '/scrm-api/console/sale/contract/set-setting',
    method: 'post',
    data
  })
}

//获取动态模版列表
export function getTtemplate() {
  return request({
    url: '/scrm-api/console/sale/contract/get-template',
    method: 'get'
  })
}

//新建合同
export function createContract(data:any) {
  return request({
    url: '/scrm-api/console/sale/contract/create',
    method: 'post',
    data
  })
}

//合同详情
export function getContractDetail(data:any) {
  return request({
    url: '/scrm-api/console/sale/contract/view',
    method: 'post',
    data
  })
}

//获取work
export function getWork() {
  return request({
    url: '/scrm-api/console/sale/contract/get-work',
    method: 'get'
  })
}

//查看合同详情
export function contractDetail(data:any) {
  return request({
    url: '/scrm-api/console/sale/contract/detail',
    method: 'post',
    data
  })
}

//提交审批
export function submitContract(data:any) {
  return request({
    url: '/scrm-api/console/sale/contract/submit-contract',
    method: 'post',
    data
  })
}

//撤回合同
export function withdrawContract(data:any) {
  return request({
    url: '/scrm-api/console/sale/contract/withdraw-contract',
    method: 'post',
    data
  })
}

//签署合同
export function signContract(data:any) {
  return request({
    url: '/scrm-api/console/sale/contract/sign-contract',
    method: 'post',
    data
  })
}

//审批（通过、驳回）
export function auditContract(data:any) {
  return request({
    url: '/scrm-api/console/sale/contract/audit-contract',
    method: 'post',
    data
  })
}

//签约邀请
export function inviteContract(data:any) {
  return request({
    url: '/scrm-api/console/sale/contract/invite-contract',
    method: 'post',
    data
  })
}

//获取accoun
export function getAccount(data:any) {
  return request({
    url: '/scrm-api/console/sale/contract/get-account',
    method: 'get',
    params: data
  })
}

//编辑合同
export function contractedit(data:any) {
  return request({
    url: '/scrm-api/console/sale/contract/edit',
    method: 'post',
    data
  })
}

//查看电子合同
export function viewEc(data:any) {
  return request({
    url: '/scrm-api/console/sale/contract/view-ec',
    method: 'post',
    data
  })
}

//生成电子合同
export function generateEc(data:any) {
  return request({
    url: '/scrm-api/console/sale/contract/generate-ec',
    method: 'post',
    data
  })
}

//实名认证
export function realName(data:any) {
  return request({
    url: '/scrm-api/console/sale/contract/real-name',
    method: 'post',
    data
  })
}
